package com.topit.show.wxapi.common;

import java.util.HashMap;
import java.util.Map;

import com.topit.show.wxapi.vo.JsApiTicket;

public class JsApiTicketContainer {
    private static Map<String, JsApiTicket> ticketMap = new HashMap<>();

    public static void put(String appid, JsApiTicket ticket) {
        ticketMap.put(appid, ticket);
    }

    public static JsApiTicket get(String appid) {
        JsApiTicket ticket = ticketMap.get(appid);
        if (ticket != null && !ticket.isExpires()) {
            return ticket;
        }
        return null;
    }
}
